# import requests
# import re
# from bs4 import BeautifulSoup
# res = requests.get('http://www.dianping.com/huaian/food')
# soup = BeautifulSoup(res.text,'lxml')
# # 将soup对象格式化为字符串 并通过正则表达式取出a标签的href
# re_url = re.compile(r'href="([\w,/]+)"')
# tag_list = soup.find_all(class_='nc_list')
# for tag in tag_list:
#     li_list= tag.find_all('li')
#     for li in li_list:
#         urls = li.find('a').get('href')
#         # print(urls)
#     # print(type(tag),li_list)
#
# script = soup.find('script',class_='J_auto-load')
# # print(script)
# if script:
#     tag = script.prettify()  # 将soup对象格式化为字符串 并通过正则表达式取出a标签的href
#     urls = re_url.findall(tag)
#     # print(urls)
#     for url in urls:
#         url = 'http://www.dianping.com%s' % url
#         # shop_serach_set.add(url)
#         print(url)


try:
    print('aaa')
    raise Exception('主动跑出异常')
except Exception as e:
    print('bbb')